//
//  SimpleObject.m
//  ExampleAnimatingSprite
//
//  Created by admin on 3/16/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "SimpleObject.h"

@implementation SimpleObject
@synthesize animationType,velocity,level,scale;
-(void) update: (ccTime) t {	
	self.position = ccp(self.position.x + velocity.x, self.position.y + velocity.y);
}
- (CGRect) rect {
	float scaleMod = 0.5f;
	float w = [self contentSize].width * [self scale] * scaleMod;
	float h = [self contentSize].height * [self scale] * scaleMod;
	CGPoint point = CGPointMake([self position].x - (w/2), [self position].y - (h/2));
	return CGRectMake(point.x, point.y, w, h); 
}
- (void) scaleMySprite{
    //Generate Mip Maps for the sprite
//    [self.texture generateMipmap];
//    ccTexParams texParams = { GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE };	
//    [self.texture setTexParameters:&texParams];	
//    
//    //Set other information. 
//    [self setPosition:ccp(120,20)];
//    [self setScale:scale];
    [self runAction:[CCScaleBy actionWithDuration:1.0f scale:scale]];
    NSLog(@">>>>>scale>>>>>>>%f",scale);
}
@end
